package com.maxima.maximaAttendance.pojos;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * The persistent class for the "timeLog" database table.
 * 
 */
@Entity
@Table(name = "\"timeLog\"")
@NamedQuery(name = "TimeLog.findAll", query = "SELECT t FROM TimeLog t")
public class TimeLog implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(unique = true, nullable = false)
	private Integer id;

	@Column(length = 150)
	private String comment;

	@Column	
	private Date recordDate;

	@Column	
	private Date loginTime;

	@Column	
	private Date logoutTime;

	@Column	
	private Boolean workFromHome;

	public Boolean getWorkFromHome() {
		return workFromHome;
	}

	public void setWorkFromHome(Boolean workFromHome) {
		this.workFromHome = workFromHome;
	}

	// bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name = "userid")
	private User user;


	public TimeLog(Date date,User user) {
		super();
		this.recordDate = date;
		this.user=user;
		this.workFromHome=false;
	}
	
	public TimeLog(Date date,User user,String comment) {
		super();
		this.recordDate = date;
		this.user=user;
		this.workFromHome=false;
		this.comment=comment;
	}

	public TimeLog() {
		this.workFromHome=false;
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getComment() {
		return this.comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public Date getRecordDate() {
		return recordDate;
	}

	public void setRecordDate(Date recordDate) {
		this.recordDate = recordDate;
	}

	public Date getLoginTime() {
		return loginTime;
	}

	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}

	public Date getLogoutTime() {
		return logoutTime;
	}

	public void setLogoutTime(Date logoutTime) {
		this.logoutTime = logoutTime;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}